<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
	<title>Tencent</title>
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<style>
    .fakeimg {
        height: 200px;
        background: #aaa;
    }
  </style>
</head>

<body>
<nav class="navbar navbar-inverse">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#myNavbar">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand">欢迎您！</a>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar">
				<ul class="nav navbar-nav" style="float:left">
					<li class="active"><a href="index.jsp">主页</a></li>
					<li><a href="Company.do?method=0">部门信息</a></li>
					<li><a href="Company.do?method=1">公司信息</a></li>
				</ul>
				<ul class="nav navbar-nav" style="float:right">
					<%
						if (session.getAttribute("user") != null) {
					%>
					<li><a href="${pageContext.request.contextPath}/Logout.do">登出</a> <%
 	} else {
 %> <a class="navbar-brand"
						href="${pageContext.request.contextPath}/Login.do?method=0">请先登录</a>
						<%
							}
						%>
					</li>
				</ul>
			</div>
		</div>
	</nav>

	<table class="table table-bordered">
		<caption>用户列表</caption>
		<thead>
			<tr>
				<th>ID</th>
				<th>姓名</th>
			</tr>
		</thead>
		<c:forEach items="${listR}" var="list">
			<tbody>
				<tr>
					<td>${list.id}</td>
					<td><a href="Admin.do?method=2&id=${list.id}">${list.name}</a></td>
				</tr>
			</tbody>
		</c:forEach>
	</table>

	<div style="text-align: center;">
		<nav>
			<ul class="pagination">
				<li class="page-item ${page==1?'disabled':''}"><a
					class="page-link"
					href="<c:url value="/Admin.do?method=0&page=${page-1>1?page-1:1}"/>">上一页</a>
				</li>
				<c:if test="${page!=1}">
					<li class="page-item"><a class="page-link"
						href="<c:url value="/Admin.do?method=0&page=1"/>">1</a>
					</li>
				</c:if>
				<c:if test="${page>2}">
					<li class="page-item disabled"><a class="page-link">...</a>
					</li>
				</c:if>
				<li class="page-item active"><a class="page-link"
					href="<c:url value="/Admin.do?method=0&page=${page}"/>">${page}</a>
				</li>
				<c:if test="${totalPages-page>1}">
					<li class="page-item disabled"><a class="page-link">...</a>
					</li>
				</c:if>
				<c:if test="${page!=totalPages}">
					<li class="page-item"><a class="page-link"
						href="<c:url value="/Admin.do?method=0&page=${totalPages}"/>">${totalPages}</a>
					</li>
				</c:if>

				<li class="page-item ${page==totalPages?'disabled':''}"><a
					class="page-link"
					href="<c:url value="/Admin.do?method=0&page=${page+1<totalPages?page+1:totalPages}"/>">下一页</a>
				</li>
			</ul>
		</nav>
	</div>

	<div class="jumbotron text-center" style="margin-bottom:0;margin-top: 550px;">
  版权所有 © Copyright 2018-2100 03160519 康楠  中国·广东珠海吉林大学珠海学院
</div>
</body>
</html>
